﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Web.Models.Reservation>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Reservations
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Reservations</h2>

<p>
    <%: Html.ActionLink("Create New", "Create") %>
</p>
<table id="table">
    <thead>
        <tr>
            <th>
                <%: Html.DisplayNameFor(model => model.Title) %>
            </th>
            <th>
                <%: Html.DisplayNameFor(model => model.Begin) %>
            </th>
            <th>
                <%: Html.DisplayNameFor(model => model.End) %>
            </th>
            <th>
                Room
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
<% foreach (var item in Model) { %>
        <tr>
            <td>
                <%: Html.DisplayFor(modelItem => item.Title) %>
            </td>
            <td>
                <%: Html.DisplayFor(modelItem => item.Begin) %>
            </td>
            <td>
                <%: Html.DisplayFor(modelItem => item.End) %>
            </td>
            <td>
                <%: item.Room.Name %>
            </td>
            <td>
                <%: Html.ActionLink("Details", "Details", new { id=item.Id }) %> |
                <%: Html.ActionLink("Delete", "Delete", new { id=item.Id }) %>
            </td>
        </tr>
<% } %>
    </tbody>
</table>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="FeaturedContent" runat="server">
    <%: Styles.Render("~/Content/css/datatables") %>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="ScriptsSection" runat="server">
    <%: Scripts.Render("~/bundles/datatables") %>
    <script type="text/javascript">
        $('#table').dataTable();
    </script>
</asp:Content>
